#ifndef _DEFINED_H_
#define _DEFINED_H_


// for stream input type
#define STREAM_INPUT_WEBCAM		0
#define STREAM_INPUT_IPCAMERA	1
#define STREAM_INPUT_SCREEN		2
#define STREAM_INPUT_VIDEO		3

// Stream input device info
typedef struct _INPUT_DEVICE_ 
{
	int		type;
	char	name[64];
	void*	self_info;
} INPUT_DEVICE;

typedef struct _DEVICE_IPCAMERA_
{
	char address[16];
	char id[64];
	char password[32];
	int	 model;
} DEVICE_IPCAMERA;

typedef struct _DEVICE_WEBCAMERA_
{
	char name[64];
	char version[64];
} DEVICE_WEBCAMERA;



// share memory related variabe type
#define MAX_MEMORY_MAP		0x8000000  // 128MB
#define MAX_RAW_YUV_SIZE	3226496
#define MAX_RAW_AUDIO_SIZE	50000
#define MAX_DVR_CHANNEL		32

#define MAX_FIRST_MEMORY_SIZE 0x20000 // 128KB

typedef struct{
	int	length;
	char	audioData[MAX_RAW_AUDIO_SIZE];
} AUDIO_DATA;
typedef struct{
	int	length;
	char	imageData[MAX_RAW_YUV_SIZE];
} IMAGE_DATA;
// share map structure
typedef struct{
	int flag;
	__int64 atimestamp;
	__int64 vtimestamp;
	CRITICAL_SECTION audioLock;
	CRITICAL_SECTION imageLock;
	int audioFourCc;
	AUDIO_DATA audio;
	int imageFourCc;
	IMAGE_DATA image;
	char videoInName[200];
	int videoConnection;
	int width;
	int height;
} NVR_RAW_IMAGE;

#endif	//_DEFINED_H_